import {defineConfig} from 'vite'
import vue2 from '@vitejs/plugin-vue2'
import path from 'path'
import vueJsx from "@vitejs/plugin-vue2-jsx";

/**
 * Vite配置文件
 * @see https://vitejs.dev/config/
 */
import dotenv from 'dotenv'
dotenv.config();
export default defineConfig({
    plugins: [
        vue2(),
        vueJsx(),],
    resolve: {
        alias: {
            '@': path.resolve(__dirname, './src')
        }
    },
    define: {
        'process.env': {

            "isvite":5,
            // VUE_APP_BASE_API: 'http://127.0.0.1:9001/',
            ... process.env,
        },
    },
    server: {
        port: 3000,
        open: true
    },
    css: {
        preprocessorOptions: {
            scss: {
                additionalData: `@use "@/assets/styles/variables.scss" as *;`
            }
        }
    },
    build: {
        outDir: 'dist',
        assetsDir: 'assets',
        minify: 'terser',
        terserOptions: {
            compress: {
                drop_console: true,
                drop_debugger: true
            }
        }
    }
})
